/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package renderers;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import model.Module;
import model.Program;
/**
 *
 * @author admin
 */
public class programComboBoxRenderer extends DefaultListCellRenderer
{
    
    @Override
    public Component getListCellRendererComponent(
            JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
    {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        if (value instanceof Program)
          {
            Program mec = (Program) value;
            setText(mec.getDescription());
          }
        return this;
    }
    
}
